﻿namespace QLPhongKham.UC
{
    using ConfigDatabase.Class;
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraTab;
    using QLPhongKham.Access;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class UCthongso : XtraUserControl
    {
        private ConnectDatabase _condata;
        private General.DThongSo _tschung;
        private SimpleButton btnketthuc;
        private SimpleButton btnluu;
        private IContainer components = null;
        private Label label1;
        private Label label2;
        private Label label25;
        private Label label3;
        private Label label5;
        private TextEdit txtdiachi;
        private TextEdit txtdienthoai;
        private TextEdit txtemail;
        private TextEdit txttenbv;

        public UCthongso()
        {
            this.InitializeComponent();
        }

        private void btnketthuc_Click(object sender, EventArgs e)
        {
            try
            {
                XtraTabPage parent = (XtraTabPage) base.Parent;
                XtraTabControl control = (XtraTabControl) parent.Parent;
                control.TabPages.Remove(parent);
            }
            catch
            {
                try
                {
                    XtraUserControl control2 = (XtraUserControl) base.Parent;
                    control2.Controls.Remove(this);
                }
                catch
                {
                    ((Form) base.Parent).Close();
                }
            }
        }

        private void btnluu_Click(object sender, EventArgs e)
        {
            this.f_thongso_save();
            MessageBox.Show("Lưu th\x00e0nh c\x00f4ng.", "Th\x00f4ng b\x00e1o", MessageBoxButtons.OK);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void f_thongso_load()
        {
            this.txttenbv.Text = this._tschung.pTenBV;
            this.txtdiachi.Text = this._tschung.pDiaChi;
            this.txtdienthoai.Text = this._tschung.pDienThoai;
            this.txtemail.Text = this._tschung.pEmail;
        }

        private void f_thongso_save()
        {
            this._tschung.pTenBV = this.txttenbv.Text;
            this._tschung.pDiaChi = this.txtdiachi.Text;
            this._tschung.pDienThoai = this.txtdienthoai.Text;
            this._tschung.pEmail = this.txtemail.Text;
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(UCthongso));
            this.btnketthuc = new SimpleButton();
            this.btnluu = new SimpleButton();
            this.label5 = new Label();
            this.label25 = new Label();
            this.txttenbv = new TextEdit();
            this.label1 = new Label();
            this.txtdiachi = new TextEdit();
            this.label2 = new Label();
            this.txtdienthoai = new TextEdit();
            this.label3 = new Label();
            this.txtemail = new TextEdit();
            this.txttenbv.Properties.BeginInit();
            this.txtdiachi.Properties.BeginInit();
            this.txtdienthoai.Properties.BeginInit();
            this.txtemail.Properties.BeginInit();
            base.SuspendLayout();
            this.btnketthuc.Anchor = AnchorStyles.Bottom;
            this.btnketthuc.Appearance.Options.UseTextOptions = true;
            this.btnketthuc.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnketthuc.Image = Properties.Resources.imgclose;// (Image)manager.GetObject("btnketthuc.Image");
            this.btnketthuc.Location = new Point(0x113, 0x84);
            this.btnketthuc.Name = "btnketthuc";
            this.btnketthuc.Size = new Size(0x4f, 0x17);
            this.btnketthuc.TabIndex = 5;
            this.btnketthuc.Text = " &Kết th\x00fac";
            this.btnketthuc.Click += new EventHandler(this.btnketthuc_Click);
            this.btnluu.Anchor = AnchorStyles.Bottom;
            this.btnluu.Appearance.Options.UseTextOptions = true;
            this.btnluu.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            this.btnluu.Image = Properties.Resources.imgsave;// (Image)manager.GetObject("btnluu.Image");
            this.btnluu.Location = new Point(0xd0, 0x84);
            this.btnluu.Name = "btnluu";
            this.btnluu.Size = new Size(0x3f, 0x17);
            this.btnluu.TabIndex = 4;
            this.btnluu.Text = " &Lưu";
            this.btnluu.Click += new EventHandler(this.btnluu_Click);
            this.label5.Font = new Font("Tahoma", 10f);
            this.label5.Location = new Point(-6, 0x33);
            this.label5.Name = "label5";
            this.label5.Size = new Size(0x6d, 0x15);
            this.label5.TabIndex = 0x17;
            this.label5.Text = "T\x00ean bệnh viện:";
            this.label5.TextAlign = ContentAlignment.TopRight;
            this.label25.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.label25.BackColor = Color.Green;
            this.label25.Font = new Font("Tahoma", 16f);
            this.label25.ForeColor = Color.White;
            this.label25.Location = new Point(0, 0);
            this.label25.Name = "label25";
            this.label25.Size = new Size(0x204, 0x2d);
            this.label25.TabIndex = 0x1a;
            this.label25.Text = "TH\x00d4NG TIN";
            this.label25.TextAlign = ContentAlignment.MiddleLeft;
            this.txttenbv.Location = new Point(100, 0x30);
            this.txttenbv.Name = "txttenbv";
            this.txttenbv.Properties.Appearance.Font = new Font("Microsoft Sans Serif", 10f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.txttenbv.Properties.Appearance.Options.UseFont = true;
            this.txttenbv.Properties.CharacterCasing = CharacterCasing.Upper;
            this.txttenbv.Size = new Size(0x197, 0x16);
            this.txttenbv.TabIndex = 0;
            this.label1.Font = new Font("Tahoma", 10f);
            this.label1.Location = new Point(6, 0x4f);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x61, 0x15);
            this.label1.TabIndex = 0x17;
            this.label1.Text = "Địa chỉ:";
            this.label1.TextAlign = ContentAlignment.TopRight;
            this.txtdiachi.Location = new Point(100, 0x4c);
            this.txtdiachi.Name = "txtdiachi";
            this.txtdiachi.Properties.Appearance.Font = new Font("Microsoft Sans Serif", 10f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.txtdiachi.Properties.Appearance.Options.UseFont = true;
            this.txtdiachi.Properties.CharacterCasing = CharacterCasing.Upper;
            this.txtdiachi.Size = new Size(0x197, 0x16);
            this.txtdiachi.TabIndex = 1;
            this.label2.Font = new Font("Tahoma", 10f);
            this.label2.Location = new Point(6, 0x6b);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x61, 0x15);
            this.label2.TabIndex = 0x17;
            this.label2.Text = "Điện thoại:";
            this.label2.TextAlign = ContentAlignment.TopRight;
            this.txtdienthoai.Location = new Point(100, 0x68);
            this.txtdienthoai.Name = "txtdienthoai";
            this.txtdienthoai.Properties.Appearance.Font = new Font("Microsoft Sans Serif", 10f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.txtdienthoai.Properties.Appearance.Options.UseFont = true;
            this.txtdienthoai.Properties.CharacterCasing = CharacterCasing.Upper;
            this.txtdienthoai.Size = new Size(0xab, 0x16);
            this.txtdienthoai.TabIndex = 2;
            this.label3.Font = new Font("Tahoma", 10f);
            this.label3.Location = new Point(0x105, 0x69);
            this.label3.Name = "label3";
            this.label3.Size = new Size(0x48, 0x15);
            this.label3.TabIndex = 0x17;
            this.label3.Text = "Email:";
            this.label3.TextAlign = ContentAlignment.TopRight;
            this.txtemail.Location = new Point(0x14b, 0x68);
            this.txtemail.Name = "txtemail";
            this.txtemail.Properties.Appearance.Font = new Font("Microsoft Sans Serif", 10f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.txtemail.Properties.Appearance.Options.UseFont = true;
            this.txtemail.Properties.CharacterCasing = CharacterCasing.Upper;
            this.txtemail.Size = new Size(0xb0, 0x16);
            this.txtemail.TabIndex = 3;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.txtemail);
            base.Controls.Add(this.txtdienthoai);
            base.Controls.Add(this.txtdiachi);
            base.Controls.Add(this.label3);
            base.Controls.Add(this.txttenbv);
            base.Controls.Add(this.label2);
            base.Controls.Add(this.label25);
            base.Controls.Add(this.label1);
            base.Controls.Add(this.label5);
            base.Controls.Add(this.btnluu);
            base.Controls.Add(this.btnketthuc);
            this.LookAndFeel.UseWindowsXPTheme = true;
            base.Name = "UCthongso";
            base.Size = new Size(0x204, 0xa2);
            base.Load += new EventHandler(this.UCphanquyensudung_Load);
            this.txttenbv.Properties.EndInit();
            this.txtdiachi.Properties.EndInit();
            this.txtdienthoai.Properties.EndInit();
            this.txtemail.Properties.EndInit();
            base.ResumeLayout(false);
        }

        private void UCphanquyensudung_Load(object sender, EventArgs e)
        {
            if (this._condata == null)
            {
                this._condata = new ConnectDatabase();
            }
            this._tschung = new General.DThongSo(this._condata);
            this.f_thongso_load();
        }

        public ConnectDatabase pCondata
        {
            get
            {
                return this._condata;
            }
            set
            {
                this._condata = value;
            }
        }
    }
}

